package DD1;

public class GenericityT {

	public static void main(String[] args) {
		Integer [] arrInt = {1,2,3,4,5};
		String [] arrStr = {"AA","BB","CC"};
 		PrintAll(arrInt);
 		PrintAll(arrStr);
 		System.out.println("The maxium is "+ GetMax(123, 432, 324));
 		System.out.println("The maxium is "+ GetMax("AA","BB","CC"));
	}
	private static <Z> void PrintAll(Z[] In) {
		for (Z e : In) {
			System.out.print(e);
		}
		System.out.println();
	}
	private static <T extends Comparable<T>> T GetMax(T X , T Y , T Z ) {
		T max = X;
		if (Y.compareTo(max)>0) {
			max = Y;
		}
		if (Z.compareTo(max)>0) {
			max = Z;
		}
		return max;
	}
}
